<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml"$if(lang)$ lang="$lang$" xml:lang="$lang$"$endif$>

<head>

<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width">
<meta property="og:title" content="$pagetitle$" />
$if(url)$<meta property="og:url" content="$url$" />$endif$
$if(cover-image)$<meta property="og:image" content="$url$$cover-image$" />$endif$
$if(description)$<meta property="og:description" content="$description$" />$endif$

$for(author-meta)$
<meta name="author" content="$author-meta$" />
$endfor$

$if(date-meta)$
<meta name="date" content="$date-meta$" />
$endif$

<meta name="description" content="$if(description)$$description$$else$$pagetitle$$endif$">

<script id="pandoc-meta" type="application/json">
$meta-json$
</script>

<title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>

$if(math)$
$if(mathjax)$
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function() {
  // Retrieve previous config object if defined
  window.PagedConfig = window.PagedConfig || {};
  let beforePaged = PagedConfig.before;
  window.PagedConfig.before = async () => {
    if (beforePaged) await beforePaged();
    return new Promise((resolve, reject) => {
      var script = document.createElement("script");
      script.type = "text/javascript";
      var src = `$mathjaxurl$` + "?config=TeX-MML-AM_CHTML";
      if (location.protocol !== "file:" && /^https?:/.test(src))
        src = src.replace(/^https?:/, '');
      script.src = src;
      window.MathJax = {
        AuthorInit: () => {
          MathJax.Hub.Register.StartupHook("Begin", () => {
            MathJax.Hub.Queue(resolve);
          });
        }
      };
      document.getElementsByTagName("head")[0].appendChild(script);
    });
  };
})();
</script>
$endif$
$endif$

$for(header-includes)$
$header-includes$
$endfor$

$if(highlightjs)$
<link rel="stylesheet"
      href="$highlightjs$/$if(highlightjs-theme)$$highlightjs-theme$$else$default$endif$.css"
      $if(html5)$$else$type="text/css" $endif$/>
<script src="$highlightjs$/highlight.js"></script>
$if(theme)$
<style type="text/css">
  pre:not([class]) {
    background-color: white;
  }
</style>
$endif$
<script type="text/javascript">
if (window.hljs && document.readyState && document.readyState === "complete") {
   window.setTimeout(function() {
      hljs.initHighlighting();
   }, 0);
}
</script>
$endif$

$if(highlighting-css)$
<style type="text/css">
$highlighting-css$
</style>
$if(theme)$
<style type="text/css">pre:not([class]) { background-color: white; }</style>
$endif$
$endif$

$if(abstract)$
<style type="text/css">
  h3.abstract{
    text-align: center;
  }
  div.abstract{
    margin: auto;
    width: 90%;
  }
</style>
$endif$

$for(css)$
<link rel="stylesheet" href="$css$" $if(html5)$$else$type="text/css" $endif$/>
$endfor$

$if(theme)$
<style type = "text/css">
.main-container {
  max-width: 940px;
  margin-left: auto;
  margin-right: auto;
}
code {
  color: inherit;
  background-color: rgba(0, 0, 0, 0.04);
}
img {
  max-width:100%;
  height: auto;
}
</style>
$endif$
</head>

<body>

<div class="running-h1-title"></div>

<div class="running-h2-title"></div>

$if(theme)$
<div class="container-fluid main-container">
$endif$

$for(include-before)$
$include-before$
$endfor$

<div class="front-page">
$if(title)$
<div id="$idprefix$header" class="title-page">
$if(shorttitle)$
<h1 class="shorttitle1" style="display: none;">$shorttitle$</h1>
$endif$
<h1 class="title">$title$</h1>
$if(subtitle)$
<h1 class="subtitle"><span>$subtitle$</span></h1>
$endif$
$for(author)$
$if(author.name)$
<h2 class="author">$author.name$</h2>
$if(author.affiliation)$
<address class="author-afil">
$author.affiliation$<br/>$endif$
$if(author.email)$
<a class="author-email" href="mailto:#">$author.email$</a>
</address>
$endif$
$else$
<h2 class="author">$author$</h2>
$endif$
$endfor$
$if(date)$
<h2 class="date">$date$</h2>
$endif$
</div>
$if(abstract)$
<div class="abstract">
<h3 class="abstract">$if(abstract-title)$$abstract-title$$else$Abstract$endif$</h3>
$abstract$
</div>
$endif$
$endif$
</div>

<div class="front-matter-container">
$if(toc)$
<div id="$idprefix$TOC" class="level1 toc front-matter">
$if(toc-title)$
<h1 class="toc-title">$toc-title$</h1>
$endif$
$table-of-contents$
</div>
$endif$
</div>

<div class="main">
$body$
</div>

$for(include-after)$
$include-after$
$endfor$

$if(theme)$
</div>

<script>
// add bootstrap table styles to pandoc tables
$$(document).ready(function () {
  $$('tr.header').parent('thead').parent('table').addClass('table table-condensed');
});
</script>
$endif$

<script>
// when the page is about to reload via servr, remember the scroll position
document.addEventListener('servr:reload', function(e) {
  sessionStorage.setItem('pagedown-scroll', window.scrollY);
});
</script>
</body>
</html>
